<%-- 
    Document   : error
    Created on : Oct 6, 2012, 5:54:53 PM
    Author     : natz
--%>

<%@page import="com.myapp.actions.client.ListClients"%>
<%@page import="com.myweb.MyWeb"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="mw" uri="/WEB-INF/tlds/myweb" %>
<mw:action action="<%=new ListClients()%>" result="result"/>
<c:choose>
    <c:when test="${result.size() > 0}" >
        <table id="client-list" class="table table-bordered table-hover">
            <tr class="header-row">
                <th>Client ID</th>
                <th>Last Name</th>
                <th>First Name</th>
                <th>Age</th>
                <th>Sex</th>
            </tr>
            <c:forEach items="${result}" var="client">
                <tr data-id="${client.id}">
                    <td>${client.id}</td>
                    <td>${client.lastName}</td>
                    <td class="client-firstname">${client.firstName}</td>
                    <td>${client.age}</td>
                    <td>${client.sex}</td>
                </tr>
            </c:forEach>
        </table>
    </c:when>
    <c:otherwise>
        <div class="alert">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <strong>Warning!</strong> No data
        </div>
    </c:otherwise>
</c:choose>

